﻿<Window x:Class="PhotoKiosk.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:PhotoKiosk.ViewModel"
        xmlns:vw="clr-namespace:PhotoKiosk.View"
        xmlns:vmuc="clr-namespace:PhotoKiosk.ViewModel.UserControls"
        xmlns:vwuc="clr-namespace:PhotoKiosk.View.UserControls"
        xmlns:resx="clr-namespace:PhotoKiosk.Properties"
        Title="{x:Static resx:Resources.AppName}" WindowStartupLocation="CenterScreen" WindowStyle="None" Topmost="True" Icon="View/Images/AppIcon.png" ResizeMode="NoResize"
        Height="{Binding SystemParameters.PrimaryScreenHeight}" 
        Width="{Binding SystemParameters.PrimaryScreenWidth}" WindowState="Maximized" >
    <Window.Resources>
        <DataTemplate DataType="{x:Type vm:SelectSourceViewModel}">
            <vw:SelectSourceView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:OrderDetailsViewModel}">
            <vw:OrderDetailsView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:PaperSelectViewModel}">
            <vw:PaperSelectView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:PhotosSelectViewModel}">
            <vw:PhotosSelectView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:PhotoSectionViewModel}">
            <vw:PhotoSectionView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:FinishOrderViewModel}">
            <vw:FinishOrderView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:PaperSizeViewModel}">
            <vwuc:PaperSizeView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:LanguageButtonViewModel}">
            <vwuc:LanguageButtonView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ExitSystemViewModel}">
            <vw:ExitSystemView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SystemSettingsViewModel}">
            <vw:SystemSettingsView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:KeyboardAndTextViewModel}">
            <vwuc:KeyboardAndTextView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:NumbersPadAndTextViewModel}">
            <vwuc:NumbersPadAndTextView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:PaperFrameButtonViewModel}">
            <vwuc:PaperFrameButtonView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vmuc:PaperTypeButtonViewModel}">
            <vwuc:PaperTypeButtonView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ProcessingViewModel}">
            <vw:ProcessingView/>
        </DataTemplate>
        <Style x:Key="{x:Type Button}" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="Chrome" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="Transparent"/>
                                <Setter Property="Opacity" TargetName="Chrome" Value="0.2"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBox}">
            <Setter Property="MinHeight" Value="20" />
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Margin" Value="0"/>
            <!--  <Setter Property="IsEnabled" Value="{DynamicResource WriteAble}"/> -->
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="VerticalContentAlignment" Value="Top" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="BorderBrush" Value="Transparent" />
            <Style.Triggers>
                <!--Resolves multiline textbox vertical alignment problem-->
                <Trigger Property="TextWrapping" Value="NoWrap">
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Window.Background>
        <ImageBrush ImageSource="View/Images/bg.jpg"/>
    </Window.Background>
    <DockPanel>
        <StackPanel Orientation="Horizontal" FlowDirection="RightToLeft" DockPanel.Dock="Top" VerticalAlignment="Top" Height="70">
            <Button Command="{Binding ExitCommand}" Width="65" VerticalAlignment="Center" Background="#FFF53737" Margin="5,0,0,0">
                <StackPanel>
                    <Image Source="View/Images/Exit.png" Width="45"/>
                    <TextBlock Text="{x:Static resx:Resources.Exit}" VerticalAlignment="Bottom" FontSize="15" Foreground="Black" HorizontalAlignment="Center" />
                </StackPanel>
            </Button>
            <Button Command="{Binding CancelOrderCommand}" FontSize="30" Foreground="Black" Height="60" VerticalAlignment="Center" Width="237" Background="#FF6189B2" Margin="5,0,0,0">
                <StackPanel  Orientation="Horizontal" >
                    <Image Source="View/Images/back.png" Width="45" Margin="0,0,10,0"/>
                    <TextBlock Text="{x:Static resx:Resources.CancelOrder}" />
                </StackPanel>
            </Button>
        </StackPanel>
        <Label DockPanel.Dock="Bottom" Content="{x:Static resx:Resources.DeveloperName}" FontSize="14" FontWeight="Bold" Grid.Column="1" Height="30" Background="White" Opacity="0.30" />
        <ContentControl DockPanel.Dock="Right" Content="{Binding CurrentViewModel, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
    </DockPanel>
</Window>
